#include "stdafx.h"
#include "base/common/util.h"

namespace xBase
{
    namespace common
    {
        GUID CreateGuid()
        {
            HRESULT hRet = ::CoInitialize(NULL);

            GUID guid;

            if (S_OK != ::CoCreateGuid(&guid))
            {
                assert(!"create guid failure!");
            }

            if (S_OK == hRet)
            {
                ::CoUninitialize();
            }

            return guid;
        }
    }
}